package com.xbongbong.paas.pojo.dto;

import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.pojo.BusinessRulesPoJo;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * @author: wufeng
 * @date: 2018/12/28 16:49
 * @desrcption:
 */
@Getter
@Setter
@ToString
public class ActiveRuleDTO extends BaseDTO {


    private static final long serialVersionUID = -2786155942222501044L;

    /**
     * 规则
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<BusinessRulesPoJo> ruleList;

    /**
     * 数据
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private PaasFormDataEntity paasFormDataEntity;
    /**
     * 旧数据
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private PaasFormDataEntity oldPaasFormDataEntity;

    /**
     * 字段列表
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<FieldAttrEntity> explainList;

    /**
     * 数据id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Long dataId;

    /**
     * 数据id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer businessType;

    /**
     * 数据id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer saasMark;

    /**
     * 表单id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Long formId;


    /**
     * 是否是从编辑过来的
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer editFlag;

    /**
     * 是否是从导入过来的
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer isImport;

    public ActiveRuleDTO() {
    }
    public ActiveRuleDTO( PaasFormDataEntity paasFormDataEntity, List<FieldAttrEntity> explainList, Long dataId, Long formId, Integer businessType, Integer saasMark, String corpid, UserVO userVO, Integer editFlag, String platform) {
        this.paasFormDataEntity = paasFormDataEntity;
        this.explainList = explainList;
        this.dataId = dataId;
        this.formId = formId;
        this.businessType = businessType;
        this.saasMark = saasMark;
        this.editFlag = editFlag;
        setCorpid(corpid);
        setLoginUser(userVO);
        setUserId(userVO.getUserId());
        setLoginUserName(userVO.getName());
        setPlatform(platform);
    }

    public ActiveRuleDTO( PaasFormDataEntity paasFormDataEntity, PaasFormDataEntity oldPaasFormDataEntity, List<FieldAttrEntity> explainList, Long dataId, Long formId, Integer businessType, Integer saasMark,
                          String corpid, UserVO userVO, Integer editFlag, String platform) {
        this.paasFormDataEntity = paasFormDataEntity;
        this.oldPaasFormDataEntity = oldPaasFormDataEntity;
        this.explainList = explainList;
        this.dataId = dataId;
        this.formId = formId;
        this.businessType = businessType;
        this.saasMark = saasMark;
        this.editFlag = editFlag;
        setCorpid(corpid);
        setLoginUser(userVO);
        setUserId(userVO.getUserId());
        setLoginUserName(userVO.getName());
        setPlatform(platform);
    }
    public ActiveRuleDTO(List<BusinessRulesPoJo> ruleList, PaasFormDataEntity paasFormDataEntity, PaasFormDataEntity oldPaasFormDataEntity,
                           List<FieldAttrEntity> explainList, Long dataId, Integer businessType, Integer saasMark,
                         String corpid, UserVO userVO, Integer editFlag, String platform, String httpHeader, String browserInfo, String ip, String locale, Integer  isImport) {
        this.ruleList = ruleList;
        this.paasFormDataEntity = paasFormDataEntity;
        this.oldPaasFormDataEntity = oldPaasFormDataEntity;
        this.explainList = explainList;
        this.dataId = dataId;
        this.businessType = businessType;
        this.saasMark = saasMark;
        this.editFlag = editFlag;
        this.isImport = isImport;
        setCorpid(corpid);
        setLoginUser(userVO);
        setUserId(userVO.getUserId());
        setLoginUserName(userVO.getName());
        setPlatform(platform);
        setHttpHeader(httpHeader);
        setBrowserInfo(browserInfo);
        setIp(ip);
        setLocale(locale);
    }
}
